<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>一证通线索表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <form id="yztTrackInfo_form">
        <div class="fieldset1 tabel_col clearFix">
            <div class="fieldBox col_50">
                <div class="label">姓名</div>
                <div class="field">
                    ${yztTrackInfoVO.cstNm}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">手机号</div>
                <div class="field">
                    ${yztTrackInfoVO.cstMp}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">意向车型</div>
                <div class="field">
                    ${yztTrackInfoVO.preferMdl}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">车辆品牌</div>
                <div class="field">
                    ${yztTrackInfoVO.vehBd}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">预算价款</div>
                <div class="field">
                    ${yztTrackInfoVO.budgetCdNm}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">地区</div>
                <div class="field">
                    <input name="rgnPrCd" id="rgnPrCd" data-value="${yztTrackInfoVO.rgnPrCd}" placeholder="请选择" ltype="combobox" validate="{required:true,select:true}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">提报时间</div>
                <div class="field">
                    ${yztTrackInfoVO.crtTms}
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">状态</div>
                <div class="field">
                    <input name="stsCd" id="stsCd" data-value="${yztTrackInfoVO.stsCd}" placeholder="请选择" ltype="combobox" validate="{required:true,select:true}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">关闭时间</div>
                <div class="field">
                    ${yztTrackInfoVO.mdfTms}
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">备注</div>
                <div class="field">
                    <textarea name="trcRem" id="trcRem" type="text" class="ui-textbox" cols="80" rows="6" value="${yztTrackInfoVO.trcRem}" validate="{required:false,maxlength:1600}">${yztTrackInfoVO.trcRem}</textarea>
                </div>
            </div>
        </div>
        <div class="btnsBox">
            <span id="saveYztTrackInfo_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
            <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
        </div>
    </form>
</div>

<script>
    $(function() {
        var yztTrackInfoId = "${yztTrackInfoVO.id}";//主键ID
        $("#yztTrackInfo_form").ligerForm({
            validate: true
        });

        $("#stsCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("stsCd").setData(${stsCdList});
        $("#rgnPrCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("rgnPrCd").setData(${rgnPrCdList});

        /*保存*/
        $("#saveYztTrackInfo_Btn").click(function (event) {
            var form = liger.get("yztTrackInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (yztTrackInfoId == '') {//新增
                _url = '<%=path%>/yzt/yztTrackInfo/add.do';
            } else {//修改
                _url = '<%=path%>/yzt/yztTrackInfo/modify.do?id=' + yztTrackInfoId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();

                        //$("#resetBtn").click();
                        //回调刷新列表
                        //var callback=frameElement.W2W.callback;
                        //Remove_navTab();
                        //callback();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
</script>
</body>
</html>
